package jwanalytics.web;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class SessionListener implements HttpSessionListener {
	
	private static int activeSessions = 0;
	
	public void sessionCreated(HttpSessionEvent arg0) {
		activeSessions++;	
	}

	public void sessionDestroyed(HttpSessionEvent arg0) {
		activeSessions--; 	
	}

	// get the count of active session.
	public static int getActiveSessions(){
		return activeSessions;
	}	
	
}
